#include<iostream>
#include<cstring>
using namespace std;
char str[1005];
int main()
{
	int n,c,d,j;
	while(cin >> n)
	{
		for(int I = 1; I <= n; I++)
		{
			cin >> c >> d;
			cin >> str;
			int len = strlen(str);
			int step = 0;
			int flag2 = 0;
			cout << "Day #" << I << endl;
			cout << c << " " << d << endl;
			cout << str << endl;
			for(int i = 0; i < len - 1; )
			{
				int flag = 0;
				for(j = i + d + 1; j > i; j--)
				{
					flag = 0;
					if(str[j] == '.')
					{
						i = j;
						step++;
						flag = 1;
						break;
					}
				}
				if(j == i && flag == 0)
				{
					flag2 = 1;
					break;
				}
			}
			if(flag2 == 1) cout << "0" << endl;	
			else cout << step << endl;
			if(I < n) cout << endl;
		}
	}
	return 0;
}
